//todo:string 拓展方法
extension StringExtension on String {
  //string to bool
  bool toBoolean() {
    return (this.toLowerCase() == "true" || this.toLowerCase() == "1")
        ? true
        : (this.toLowerCase() == "false" || this.toLowerCase() == "0"
            ? false
            : false);
  }
}

extension DynamicExtension on dynamic {
  bool isEmpty(String? value) {
    return value == null || value.isEmpty || value == "";
  }

  bool isNotEmpty(dynamic value) {
    if (value == null) return false;
    if (value is String) return !isEmpty(value);
    return true;
  }
}
